if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[SendNoticeHistoryInsert]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[SendNoticeHistoryInsert]
GO

CREATE PROCEDURE dbo.[SendNoticeHistoryInsert]
(
	@SendNoticeQueueID int,
	@SendNoticeStatusID int,
	@ErrorMessage text,
	@SiteUrl nvarchar(1000), 
	@NoticeID int,
	@PreservationCriteria int,
	@FromAddress nvarchar(500),
	@SendNoticeCreated datetime,
	@NewSiteUrl nvarchar(1000) = NULL 
)
AS
SET NOCOUNT ON

INSERT INTO SendNoticeHistory
(
	SendNoticeQueueID,
	SendNoticeStatusID,
	ErrorMessage,
	SiteUrl,
	NoticeID, 
	PreservationCriteria,
	FromAddress,
	SendNoticeCreated,
	NewSiteUrl
) 
VALUES 
(
	@SendNoticeQueueID,
	@SendNoticeStatusID,
	@ErrorMessage,
	@SiteUrl, 
	@NoticeID, 
	@PreservationCriteria,
	@FromAddress,
	@SendNoticeCreated,
	@NewSiteUrl
)
GO